@import "./base";
@import "./block";
@import "./style";

.dragon-editor {
    position: relative;
    border: 1px solid #ccc;

    &.--hasMenu {
        padding-top: 38px;
    }

    .de-body {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 20px;
        line-height: 1.6;
    }

    // 메뉴 바 스타일
    .de-menu-bar {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 38px;
        background: #fff;
        border-bottom: 1px solid #ccc;
        z-index: 10;

        .de-menu-wrap {
            display: flex;
            overflow-x: auto;
        }

        .de-menu {
            display: flex;
            justify-content: center;
            align-items: center;
            min-width: 38px;
            height: 38px;
            border-right: 1px solid #ccc;
            box-sizing: border-box;
            cursor: pointer;

            .de-icon {
                width: 24px;
                height: 24px;
            }

            &.--lastchild {
                border-right: 0;
            }

            .de-path.--red {
                fill: #dd0000;
            }
        }

        .de-block-menu-area {
            display: none;
            position: absolute;
            top: 39px;
            left: 0;
            width: 120px;
            background: #fff;
            box-shadow: 0 2px 2px rgba(0, 0, 0, 0.25);
            z-index: 1000;

            &.--active {
                display: block;
            }

            .de-list {
                display: flex;
                flex-direction: column;
                gap: 5px;
                padding: 5px;
            }

            .de-add-block {
                line-height: 1.6;
            }
        }

        .de-link-exit-area {
            display: none;
            position: absolute;
            top: 39px;
            left: 228px;
            width: 200px;
            background: #fff;
            box-shadow: 0 2px 2px rgba(0, 0, 0, 0.25);
            z-index: 1000;

            &.--active {
                display: block;
            }

            .de-btn-area {
                display: flex;
                border-bottom: 1px solid #ccc;

                .de-btn {
                    flex: 1;
                    height: 24px;

                    &.--active {
                        background: #f1f1f1;
                    }
                }
            }

            .de-link-text-area {
                display: flex;
                column-gap: 10px;
                padding: 4px;

                .de-input {
                    flex: 1;
                    min-width: 0;
                    height: 20px;
                    padding: 0 8px;
                    border: 1px solid #ccc;
                    box-sizing: border-box;

                    &.--red {
                        border-color: red;
                    }
                }

                .de-btn {
                    min-width: 50px;
                    height: 20px;
                }
            }

            .de-link-heading-area {
                display: flex;
                flex-direction: column;
                max-height: 150px;
                padding: 8px;
                box-sizing: border-box;
                overflow-y: auto;

                .de-btn {
                    min-height: 20px;
                    text-align: left;

                    &:hover {
                        background: #f1f1f1;
                    }
                }
            }
        }
    }

    // 컨트롤 바 스타일
    .de-control-bar {
        display: none;
        position: fixed;
        height: 38px;
        background: #fff;
        border: 1px solid #ccc;
        border-width: 1px 0 0 1px;
        transform: translateX(-50%);
        z-index: 20;

        &.--active {
            display: flex;
        }

        &:empty {
            display: none;
        }

        .de-col {
            display: flex;
            align-items: center;
            column-gap: 6px;
            padding: 0 10px;
            border: 1px solid #ccc;
            border-width: 0 1px 1px 0;

            .de-selector {
                height: 100%;
                border: 0;
            }
        }
    }

    @include blockStyle("true");
    @include NodeStyle;
}
